#ifndef VARMODEDIT_H
#define VARMODEDIT_H

#include <QDialog>
#include "ui_varmodedit.h"
#include "helper.h"

class VarModEdit : public QDialog
{
	Q_OBJECT

public:
	VarModEdit(QWidget *parent = 0);
	~VarModEdit();

private:
	Ui::VarModEditClass ui;

	int lessontypeid, variantid, modid;
	bool modEdit;//editing variant or mod?

	//display description for variant
	void descriptionGroupToVariants();
	//display description for modification
	void descriptionGroupToMods();
	//refresh variants table
	void refreshVariants();
	//refresh mods table
	void refreshMods();

private slots:
	//choosing parameters
	void lessontypeChanged(int index);
	void variantChoosen(const QModelIndex &indx);
	void modActive(bool isActive);
	void modChoosen(const QModelIndex &indx);
	//text action
	void saveText();
	void descrChanged();
	//variant actions
	void removeDupVariant();
	void addVariant();
	void delVariant();
	//mod actions
	void removeDupMod();
	void addMod();
	void delMod();
};

#endif // VARMODEDIT_H
